import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '@/pages/login'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: Login,
    children: []
  },
  {
    path: '/',
    name: 'Home',
    component: Home,
    children: []
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About1.vue'),
    children: []
  },
  // {
  //   path: '/echartslog',
  //   name: '操作日志',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/echarts/oper-log-show.vue'),
  //   children: []
  // }
  ,
  {
    path: '/index',
    name: 'Index',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/index/home.vue'),
    children: [
            {
                path: '/dashboard',
                name: '首页',
                component: () => import('../views/dashboard/index'),
                // 当菜单文件中没有该页面配置时，在标签栏显示的就是这里配置的标题
                meta: {title: '首页'},
                children: []
            },
      /*系统管理*/
      {
          path:'/user/page',
          name:'用户管理',
          component: () => import('../views/user/page.vue'),
          children: []
      },
      {
        path:'/member/page',
        name:'游客用户管理',
        component: () => import('../views/user/member_page.vue'),
        children: [ ]
    },
      {
        path:'/role/page',
        name:'角色管理',
        component: () => import('../views/role-page.vue'),
        children: []
    },
     {
      path:'/menu/page',
      name:'菜单管理',
      component: () => import('../views/menu-page.vue'),
      children: []
    },
    {
     path:'/role/list1',
     name:'权限管理',
     component: () => import('../views/About2.vue'),
     children: []
   },
   {
    path:'/news/page',
    name:'新闻管理',
    component: () => import('../views/news/page.vue'),
    children: []
   },
   {
    path:'/order/page',
    name:'订单管理',
    component: () => import('../views/order/MyOrder.vue'),
    children: []
   },
   {
    path:'/echartslog',
    name:'操作管理',
    component: () => import('../views/echarts/oper-log-show.vue'),
    children: []
   },
   {
    path:'/loginechartslog',
    name:'登录日志管理',
    component: () => import('../views/echarts/login-log-show.vue'),
    children: []
   }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
